using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DataAccessLayer
{
    public class DAO_Test_Figure_Link
    {
        public static bool Insert(Object tmp)
        {
            TEST_FIGURE_LINK obj = (TEST_FIGURE_LINK)tmp;
            bool result = false;
            List<SqlParameter> _list = new List<SqlParameter>();
            _list.Add(new SqlParameter("@TEST_FIGURE_LINK_ID", obj.TEST_FIGURE_DESC));
            _list.Add(new SqlParameter("@USER_ID", obj.TEST_FIGURE_ID));
            _list.Add(new SqlParameter("@TEST_FIGURE_LINK_PASSWORD", obj.TEST_FIGURE_PATH));

            int n = clsDataAccessHelper.ExecNonQuery("sp_test_figure_link_insert", _list);
            if (n == 1)
                result = true;
            return result;
        }

        public static bool Update(Object tmp)
        {
            TEST_FIGURE_LINK obj = (TEST_FIGURE_LINK)tmp;
            bool result = false;
            List<SqlParameter> _list = new List<SqlParameter>();
            _list.Add(new SqlParameter("@TEST_FIGURE_LINK_ID", obj.TEST_FIGURE_DESC));
            _list.Add(new SqlParameter("@USER_ID", obj.TEST_FIGURE_ID));
            _list.Add(new SqlParameter("@TEST_FIGURE_LINK_PASSWORD", obj.TEST_FIGURE_PATH));

            int n = clsDataAccessHelper.ExecNonQuery("sp_test_figure_link_update", _list);
            if (n == 1)
                result = true;
            return result;
        }

        public static bool Delete(Object tmp)
        {
            TEST_FIGURE_LINK obj = (TEST_FIGURE_LINK)tmp;
            bool result = false;
            List<SqlParameter> _list = new List<SqlParameter>();
            _list.Add(new SqlParameter("@TEST_FIGURE_LINK_ID", obj.TEST_FIGURE_DESC));
            _list.Add(new SqlParameter("@USER_ID", obj.TEST_FIGURE_ID));
            _list.Add(new SqlParameter("@TEST_FIGURE_LINK_PASSWORD", obj.TEST_FIGURE_PATH));

            int n = clsDataAccessHelper.ExecNonQuery("sp_test_figure_link_delete", _list);
            if (n == 1)
                result = true;
            return result;
        }

        public static List<TEST_FIGURE_LINK> LoadAll()
        {
            List<TEST_FIGURE_LINK> _list = new List<TEST_FIGURE_LINK>();
            //call stored getlist here
            return _list;
        }
    }
}
